<!--
 * @FileDescription 拆装列表
 * @Author lz
 * @Date 20230224 14:41:53
 * @LastEditors lz
 * @LastEditTime 20230224 14:41:53
-->
<template>
    <div class="install_list" v-if="state.show == false">
        <div class="tit">拆装项目</div>
        <img src="/structure/DecorativeLine_l.png" class="line">
        <img src="/structure/packUp.png" class="packUp" @click="show()">
        <div class="listBox">
            <div class="ContentListBox">
                <div v-for="(item, index) in state.list" :key="item.Name">
                    <div class="title_box">
                        {{ item.Name }}
                    </div>
                    <div v-for="(items, indexs) in item.Steps" :key="items.Id" class="indexs_box">
                        <span class="textBox">{{ items.Name }}</span>
                        <img src="/structure/skipBox.png" class="skipBox">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="StowedState" v-if="!state.show == false" @click="show()">
        <img src="/structure/ExpandArrow_l.png" class="expArr">
    </div>
</template>

<script setup lang="ts">
import { ClientMessage } from '@runtime/generate/message/ClientMessage';
import WebSocketComponent from '@runtime/module/WebSocket/WebSocketComponent';
import { reactive, ref, toRefs, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onUnmounted, StyleValue, defineProps, defineEmits } from 'vue'
import MessageCode from '../../MessageCode';
import installContent from '../installMenu';
const state = reactive({
    show: false,
    list: [{
        "Name": "拆卸车轮",
        "State": 0,
        "Steps": [{
            "Id": 257,
            "Name": "预松右前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 258,
            "Name": "全松右前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 259,
            "Name": "拆卸右前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 260,
            "Name": "拆卸右前车轮",
            "State": 1
        }, {
            "Id": 261,
            "Name": "预松左前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 262,
            "Name": "全松左前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 263,
            "Name": "拆卸左前轮毂固定螺母",
            "State": 1
        }, {
            "Id": 264,
            "Name": "拆卸左前车轮",
            "State": 1
        }, {
            "Id": 265,
            "Name": "预松左后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 266,
            "Name": "全松左后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 267,
            "Name": "拆卸左后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 268,
            "Name": "拆卸左后车轮",
            "State": 1
        }, {
            "Id": 269,
            "Name": "预松右后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 270,
            "Name": "全松右后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 271,
            "Name": "拆卸右后轮毂固定螺母",
            "State": 1
        }, {
            "Id": 272,
            "Name": "拆卸右后车轮",
            "State": 1
        }]
    }]
});
function show() {
    state.show = !state.show
}

// function GetNode(item: any) {
//     console.log(item, '触发');
//     let newArr = WebSocketComponent.Default.PostMessageAsync(new ClientMessage.DisassemblyAdapterRequest(MessageCode.Default.MsgCodesList.DISASSEMBLY_STEP_GOTO, `${item.Id}`))
//     newArr.then((res: any) => {
//         console.log(JSON.parse(res.Content).Result);
//         if (JSON.parse(res.Content).Success) {
//             installContent.Default.InstallProData.value = JSON.parse(res.Content).Result
//         }
//     })
// }
// onMounted(() => {
//     WebSocketComponent.Default.PostMessageAsync(new ClientMessage.DisassemblyAdapterRequest(MessageCode.Default.MsgCodesList.DISASSEMBLY_STEP_GOTO, `${installContent.Default.InstallProData.value[0].Steps[0].Id}`))
// })
</script>

<style scoped>
.install_list {
    position: absolute;
    left: 0;
    top: 108px;
    width: 290px;
    height: 637px;
    background-image: url('/structure/cz_list_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.line {
    position: absolute;
    left: 6px;
    top: 32px;
    width: 274px;
    height: 28px;
}

.tit {
    font-size: 22px;
    font-family: YouSheBiaoTiHei;
    font-weight: 400;
    color: #ffffff;
    padding-left: 38px;
    padding-top: 12px;
}

.packUp {
    position: absolute;
    right: 4px;
    top: 13px;
    width: 27px;
    height: 32px;
}

.listBox {
    margin-top: 10px;
    width: 290px;
    height: 560px;
}

.ContentListBox {
    width: 284px;
    height: 570px;
    overflow-y: auto;
    overflow-x: hidden;
}

.ContentListBox::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 10px;
    /*高宽分别对应横竖滚动条的尺寸*/
    height: 1px;
}

.ContentListBox::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius: 10px;
    background: #6099cf;
}

.ContentListBox::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    border-radius: 10px;
    background: #054581;
}

.expArr {
    width: 27px;
    height: 32px;
    margin-top: 10px;
    margin-left: 13px;
}

.StowedState {
    position: absolute;
    left: 0;
    top: 115px;
    width: 52px;
    height: 52px;
    background-image: url('/structure/stowedState_l_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.title_box {
    font-size: 16px;
    color: #B1D0F4;
    font-weight: 400;
    line-height: 36px;
    margin-left: 20px;
}

.indexs_box {
    line-height: 36px;
    color: #B1D0F4;
    font-size: 16px;
    margin-left: 30px;
}

.textBox {
    max-width: 180px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
}
</style>